package com.tangula.web.console.hello.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.tangula.basic.context.HashMapContext;
import com.tangula.core.Context;
import com.tangula.core.Controller;
import com.tangula.web.config.auth.Ignore;
import com.tangula.web.console.hello.business.HelloBusiness;

@Ignore
@RestController
@RequestMapping("/console/hello")
public class HelloController implements Controller<Context> {

	@Autowired
	protected HelloBusiness bizHello;
	
	@RequestMapping(value="", method= {RequestMethod.GET, RequestMethod.POST})
	public Map<String, Object> hello(){
		Context ctx = new HashMapContext();
		bizHello.execute(ctx);
		return ctx.state(Context.KEY_RESULT);
	}
	
}
